using System;

namespace IllSoft.Xvcc.Volano.Client
{
    public class User
    {
        #region Members

        #endregion

        #region (De-)Constructor(s)

        public User(string nick)
            : this(nick, string.Empty)
        {
        }

        public User(string nick, string profile)
            : this(nick, profile, string.Empty)
        {
        }

        public User(string nick, string profile, string handle)
        {
            this.JoinDate = this.LastActivity = DateTime.UtcNow;

            this.Handle = handle;
            this.Nick = nick;
            this.Profile = profile;
        }

        #endregion

        #region Properties

        public string Handle { get; private set; }
        public DateTime JoinDate { get; private set; }
        public DateTime LastActivity { get; set; }
        public string Nick { get; private set; }
        public string Profile { get; private set; }

        public TimeSpan IdleTimeSpan
        {
            get
            {
                return DateTime.UtcNow - this.LastActivity;
            }
        }

        #endregion

        #region Methods

        public override string ToString()
        {
            return this.Nick;
        }

        #endregion
    }
}